package db;

// Generated 12.06.2012 19:50:00 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Enterprise generated by hbm2java
 */
@Entity
@Table(name = "enterprise")
public class Enterprise implements java.io.Serializable {

	private int enterprise;
	private Employee employeeByUpdatedBy;
	private Employee employeeByCreatedBy;
	private String name;
	private String fullName;
	private Date created;
	private Date updated;
	private Set<EnterprisePersonRelation> enterprisePersonRelations = new HashSet<EnterprisePersonRelation>(
			0);
	private Set<Employee> employees = new HashSet<Employee>(0);
	private Set<Item> items = new HashSet<Item>(0);

	public Enterprise() {
	}

	public Enterprise(int enterprise) {
		this.enterprise = enterprise;
	}

	public Enterprise(int enterprise, Employee employeeByUpdatedBy,
			Employee employeeByCreatedBy, String name, String fullName,
			Date created, Date updated,
			Set<EnterprisePersonRelation> enterprisePersonRelations,
			Set<Employee> employees, Set<Item> items) {
		this.enterprise = enterprise;
		this.employeeByUpdatedBy = employeeByUpdatedBy;
		this.employeeByCreatedBy = employeeByCreatedBy;
		this.name = name;
		this.fullName = fullName;
		this.created = created;
		this.updated = updated;
		this.enterprisePersonRelations = enterprisePersonRelations;
		this.employees = employees;
		this.items = items;
	}

	@Id
	@Column(name = "enterprise", unique = true, nullable = false)
	public int getEnterprise() {
		return this.enterprise;
	}

	public void setEnterprise(int enterprise) {
		this.enterprise = enterprise;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updated_by")
	public Employee getEmployeeByUpdatedBy() {
		return this.employeeByUpdatedBy;
	}

	public void setEmployeeByUpdatedBy(Employee employeeByUpdatedBy) {
		this.employeeByUpdatedBy = employeeByUpdatedBy;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "created_by")
	public Employee getEmployeeByCreatedBy() {
		return this.employeeByCreatedBy;
	}

	public void setEmployeeByCreatedBy(Employee employeeByCreatedBy) {
		this.employeeByCreatedBy = employeeByCreatedBy;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "full_name")
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created", length = 29)
	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated", length = 29)
	public Date getUpdated() {
		return this.updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "enterprise")
	public Set<EnterprisePersonRelation> getEnterprisePersonRelations() {
		return this.enterprisePersonRelations;
	}

	public void setEnterprisePersonRelations(
			Set<EnterprisePersonRelation> enterprisePersonRelations) {
		this.enterprisePersonRelations = enterprisePersonRelations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "enterprise")
	public Set<Employee> getEmployees() {
		return this.employees;
	}

	public void setEmployees(Set<Employee> employees) {
		this.employees = employees;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "enterprise")
	public Set<Item> getItems() {
		return this.items;
	}

	public void setItems(Set<Item> items) {
		this.items = items;
	}

}
